function checkUsername() {
	document.getElementById("checkMessage").innerHTML = "Checking...";
	username = $("#userName").val();
	if (username == null || username == "") {
		username = "x";
	}

	$.ajax({
		type : "GET",
		url : "accountservice/" + username,
		contentType : "text/plain; charset=UTF-8",
	}).done(function(data) {
		document.getElementById("checkMessage").innerHTML = data;
	}).fail(function() {
		document.getElementById("checkMessage").innerHTML = "Error. Please try again";
		console.log("FAILED: Check Username");
	});
}